Fetch RSE info from Rucio and save to a file#892
Conversation
ericvaandering
left a comment
There was a problem hiding this comment.
seems like a good start for a draft PR
|
|
||
| returns a dict of settings and attributes | ||
| ''' | ||
| rseinfo = client.get_rse(rse=rse) |
There was a problem hiding this comment.
res_info
usage and limits are unused, right?
|
|
||
| def set_rse_settings(rse: str, config: dict, dry_run: bool = True): | ||
| ''' | ||
| Setts RSE settings and attributes from a config dict |
| current_settings, current_attrs = get_info_from_rucio(rse) | ||
|
|
||
| # update settings | ||
| # TODO: Handle KeyError |
| except Duplicate: | ||
| print(f'{attribute} already exists') | ||
|
|
||
|
|
There was a problem hiding this comment.
Settings is still coming?
|
@Panos512 @ericvaandering @haozturk I made some updates. Currently, I don't have permission to directly commit to a SITECONF project (currently using T2_US_Nebraska). To test the initial upload script, I forked the SITECONF project and then ran my script to commit to it. Details here: https://gitlab.cern.ch/SITECONF/T2_US_Nebraska/-/merge_requests/1 I am also updating CMSRSE.py and the setRucioFromGitlab to read from the SITECONF//rucio directory for RSE settings and attributes. One thought I have is to include the last commit id for a config and set that as an RSE attribute: CMSRucio/docker/rucio_client/scripts/setRucioFromGitlab Lines 89 to 92 in f86e809 We could use this to keep track of the current RSE configuration. I was also thinking we could include another attribute to keep track of which storage.json is currently applied to an RSE.
Would this be a good idea? |
Would close #770
Currently in progress.
The script can first fetch RSE settings and attributes from Rucio. Will have to use the RSEClient to update settings with
update_rseand attributes withdelete_rse_attributeand thenadd_rse_attribute.The json looks like this:
{ "settings": { "setting1": "1", "setting2": "2", }, "attributes": { "attribute1": "1", "attribute2": "2" } }The question is where should we store the settings file. As with consistency checker and protocols, we could also use SITECONF in the CERN Gitlab instance.